Support role configuration parameters #305
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds an optional, repeatable
parameter
block to thepostgresql_role
resource, which is used to define arbitary configuration parameters for the role. This is equivalent to usingALTER ROLE [role] SET [param] TO [value]
.Example:
This is more or less an alternate implementation to #211, and is in line with the suggestion in a comment on that PR.
Some implementation notes:
Some configuration parameters are already supported by dedicated arguments:
search_path
,statement_timeout
,idle_in_transaction_timeout
, androle
. To prevent those existing arguments from conflicting with this one and causing perpetual diffs, those parameters cannot be set with aparameter
block.There are some peculiarities with value quoting:
Most general configuration parameters, for example
client_min_messages
, can either be quoted string literals or bare tokens in theALTER ROLE
statement. At least one —search_path
— cannot be quoted. Or rather, quoting will give you unexpected results. Others, for instancepgaudit.log
, must be quoted, or the statement will produce an error.To accommodate all circumstances including ones I wasn't able to personally test, I opted to include an optional
quote
property in theparameter
block that defaults to true, so quoting can be selectively disabled if required.Closes #210